package logrus

import "github.com/sirupsen/logrus"

//DefaultFieldHook定义会在所有级别的日志消息中加入默认字段appName="myAppName"
type DefaultFieldHook struct {
}

func (hook *DefaultFieldHook) Fire(entry *logrus.Entry) error {
	entry.Data["appName"] = "MyAppName"
	return nil
}

func (hook *DefaultFieldHook) Levels() []logrus.Level {
	return logrus.AllLevels
}